package com.framework.model.module.user;

import com.framework.common.annotation.QueryParam;
import com.framework.common.model.validation.ValidationGroup;
import com.framework.common.util.other.NumeralUtil;
import com.framework.model.base.BaseModel;
import java.io.Serializable;
import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.model.module.user.User
 * @title 用户类
 * @datetime 2024-06-20 20:28:00
 */
public class User extends BaseModel implements Serializable {
    /**
     * 启用状态 ENABLE_STATUS
     */
    @NotNull(message = "请选择启用状态", groups = {})
    @Min(message = "启用状态错误", value = NumeralUtil.POSITIVE_ONE, groups = {})
    @Max(message = "启用状态错误", value = Integer.MAX_VALUE, groups = {})
    @QueryParam(name = "enableStatus", code = "p.ENABLE_STATUS")
    private Integer enableStatus;

    /**
     * 员工状态 STAFF_STATUS
     */
//    @NotNull(message = "请选择员工状态", groups = {})
//    @Min(message = "员工状态错误", value = NumeralUtil.POSITIVE_ONE, groups = {})
//    @Max(message = "员工状态错误", value = Integer.MAX_VALUE, groups = {})
    @QueryParam(name = "staffStatus", code = "p.STAFF_STATUS")
    private Integer staffStatus;

    /**
     * 渠道状态 CHANNEL_STATUS
     */
//    @NotNull(message = "请选择渠道状态", groups = {})
//    @Min(message = "渠道状态错误", value = NumeralUtil.POSITIVE_ONE, groups = {})
//    @Max(message = "渠道状态错误", value = Integer.MAX_VALUE, groups = {})
    @QueryParam(name = "channelStatus", code = "p.CHANNEL_STATUS")
    private Integer channelStatus;

    /**
     * 帐号 ACCOUNT
     */
    @NotBlank(message = "请输入帐号", groups = {})
    @Size(message = "帐号最多20字符", max = 20, groups = {})
    @QueryParam(name = "account", code = "p.ACCOUNT")
    private String account;

    /**
     * 手机号 PHONE
     */
    @NotBlank(message = "请输入手机号", groups = {ValidationGroup.formAdd.class})
    @Size(message = "手机号最多16字符", max = 16, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "phone", code = "p.PHONE")
    private String phone;

    /**
     * 邮箱 MAIL
     */
    @NotBlank(message = "请输入邮箱", groups = {ValidationGroup.formAdd.class})
    @Size(message = "邮箱最少1至最多64个字符", min = NumeralUtil.POSITIVE_ONE, max = NumeralUtil.POSITIVE_SIXTY_FOUR, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Email(message = "请输入正确邮箱", groups = {ValidationGroup.formAdd.class})
    @QueryParam(name = "mail", code = "p.MAIL")
    private String mail;

    /**
     * 密码 PASSWORD
     */
    @NotBlank(message = "请输入密码", groups = {})
    @Size(message = "密码最多32字符", max = 32, groups = {})
    @QueryParam(name = "password", code = "p.PASSWORD")
    private String password;

    /**
     * 关联推广编码 PROMOTION_CODE
     */
    @NotBlank(message = "请输入关联推广编码", groups = {})
    @Size(message = "关联推广编码最多20字符", max = 20, groups = {})
    @QueryParam(name = "promotionCode", code = "p.PROMOTION_CODE")
    private String promotionCode;

    /**
     * 协议 0=默认， 1=同意 PROTOCOL
     */
    @QueryParam(name = "protocol", code = "p.PROTOCOL")
    private Boolean protocol;

    /**
     * 姓名 FULL_NAME
     */
    @NotBlank(message = "请输入姓名", groups = {ValidationGroup.formAdd.class})
    @Size(message = "姓名最多32字符", max = 32, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "fullName", code = "p.FULL_NAME")
    private String fullName;

    /**
     * 昵称 NICKNAME
     */
    @NotBlank(message = "请输入昵称", groups = {ValidationGroup.formAdd.class})
    @Size(message = "昵称最多32字符", max = 32, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "nickname", code = "p.NICKNAME")
    private String nickname;

    /**
     * 性别（1.女， 2.男） SEX
     */
    @NotNull(message = "请选择性别", groups = {ValidationGroup.formAdd.class})
    @Min(message = "性别错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Max(message = "性别错误", value = NumeralUtil.POSITIVE_TWO, groups = {ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "sex", code = "p.SEX")
    private Integer sex;

    /**
     * 年龄 AGE
     */
    @NotNull(message = "请选择年龄", groups = {ValidationGroup.formAdd.class})
    @Min(message = "年龄错误", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formAdd.class})
    @Max(message = "年龄错误", value = NumeralUtil.POSITIVE_GREAT_HUNDRED, groups = {ValidationGroup.formAdd.class})
    @QueryParam(name = "age", code = "p.AGE")
    private Integer age;

    /**
     * 头像编号 HEAD_PORTRAIT_ID
     */
    @NotNull(message = "请选择头像编号", groups = {})
    @Min(message = "头像编号不存在", value = NumeralUtil.POSITIVE_ONE, groups = {})
    @Max(message = "头像编号不存在", value = Long.MAX_VALUE, groups = {})
    @QueryParam(name = "headPortraitId", code = "p.HEAD_PORTRAIT_ID")
    private Long headPortraitId;

    /**
     * 头像 HEAD_PORTRAIT_URL
     */
    @NotBlank(message = "请输入头像", groups = {})
    @Size(message = "头像最多255字符", max = 255, groups = {})
    @QueryParam(name = "headPortraitUrl", code = "p.HEAD_PORTRAIT_URL")
    private String headPortraitUrl;

    /**
     * 微信代码 WE_CHAT_CODE
     */
    @NotBlank(message = "请输入微信代码", groups = {})
    @Size(message = "微信代码最多255字符", max = 255, groups = {})
    @QueryParam(name = "weChatCode", code = "p.WE_CHAT_CODE")
    private String weChatCode;

    /**
     * 微信唯一代码 WE_UNION_ID
     */
    @NotBlank(message = "请输入微信唯一代码", groups = {})
    @Size(message = "微信唯一代码最多255字符", max = 255, groups = {})
    @QueryParam(name = "weUnionId", code = "p.WE_UNION_ID")
    private String weUnionId;

    /**
     * 盐 SALT
     */
//    @NotBlank(message = "请输入盐", groups = {})
//    @Size(message = "盐最多32字符", max = 32, groups = {})
    @QueryParam(name = "salt", code = "p.SALT")
    private String salt;

    /**
     * t_user
     */
    private static final long serialVersionUID = 1L;

    public Integer getEnableStatus() {
        return enableStatus;
    }

    public void setEnableStatus(Integer enableStatus) {
        this.enableStatus = enableStatus;
    }

    public Integer getStaffStatus() {
        return staffStatus;
    }

    public void setStaffStatus(Integer staffStatus) {
        this.staffStatus = staffStatus;
    }

    public Integer getChannelStatus() {
        return channelStatus;
    }

    public void setChannelStatus(Integer channelStatus) {
        this.channelStatus = channelStatus;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account == null ? null : account.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail == null ? null : mail.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getPromotionCode() {
        return promotionCode;
    }

    public void setPromotionCode(String promotionCode) {
        this.promotionCode = promotionCode == null ? null : promotionCode.trim();
    }

    public Boolean getProtocol() {
        return protocol;
    }

    public void setProtocol(Boolean protocol) {
        this.protocol = protocol;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName == null ? null : fullName.trim();
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname == null ? null : nickname.trim();
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Long getHeadPortraitId() {
        return headPortraitId;
    }

    public void setHeadPortraitId(Long headPortraitId) {
        this.headPortraitId = headPortraitId;
    }

    public String getHeadPortraitUrl() {
        return headPortraitUrl;
    }

    public void setHeadPortraitUrl(String headPortraitUrl) {
        this.headPortraitUrl = headPortraitUrl == null ? null : headPortraitUrl.trim();
    }

    public String getWeChatCode() {
        return weChatCode;
    }

    public void setWeChatCode(String weChatCode) {
        this.weChatCode = weChatCode == null ? null : weChatCode.trim();
    }

    public String getWeUnionId() {
        return weUnionId;
    }

    public void setWeUnionId(String weUnionId) {
        this.weUnionId = weUnionId == null ? null : weUnionId.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", enableStatus=").append(enableStatus);
        sb.append(", staffStatus=").append(staffStatus);
        sb.append(", channelStatus=").append(channelStatus);
        sb.append(", account=").append(account);
        sb.append(", phone=").append(phone);
        sb.append(", mail=").append(mail);
        sb.append(", password=").append(password);
        sb.append(", promotionCode=").append(promotionCode);
        sb.append(", protocol=").append(protocol);
        sb.append(", fullName=").append(fullName);
        sb.append(", nickname=").append(nickname);
        sb.append(", sex=").append(sex);
        sb.append(", age=").append(age);
        sb.append(", headPortraitId=").append(headPortraitId);
        sb.append(", headPortraitUrl=").append(headPortraitUrl);
        sb.append(", weChatCode=").append(weChatCode);
        sb.append(", weUnionId=").append(weUnionId);
        sb.append(", salt=").append(salt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCreateId() == null ? other.getCreateId() == null : this.getCreateId().equals(other.getCreateId()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getOperaterId() == null ? other.getOperaterId() == null : this.getOperaterId().equals(other.getOperaterId()))
                && (this.getOperaterTime() == null ? other.getOperaterTime() == null : this.getOperaterTime().equals(other.getOperaterTime()))
                && (this.getOperaterStatus() == null ? other.getOperaterStatus() == null : this.getOperaterStatus().equals(other.getOperaterStatus()))
                && (this.getEnableStatus() == null ? other.getEnableStatus() == null : this.getEnableStatus().equals(other.getEnableStatus()))
                && (this.getStaffStatus() == null ? other.getStaffStatus() == null : this.getStaffStatus().equals(other.getStaffStatus()))
                && (this.getChannelStatus() == null ? other.getChannelStatus() == null : this.getChannelStatus().equals(other.getChannelStatus()))
                && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
                && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
                && (this.getMail() == null ? other.getMail() == null : this.getMail().equals(other.getMail()))
                && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
                && (this.getPromotionCode() == null ? other.getPromotionCode() == null : this.getPromotionCode().equals(other.getPromotionCode()))
                && (this.getProtocol() == null ? other.getProtocol() == null : this.getProtocol().equals(other.getProtocol()))
                && (this.getFullName() == null ? other.getFullName() == null : this.getFullName().equals(other.getFullName()))
                && (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
                && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
                && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
                && (this.getHeadPortraitId() == null ? other.getHeadPortraitId() == null : this.getHeadPortraitId().equals(other.getHeadPortraitId()))
                && (this.getHeadPortraitUrl() == null ? other.getHeadPortraitUrl() == null : this.getHeadPortraitUrl().equals(other.getHeadPortraitUrl()))
                && (this.getWeChatCode() == null ? other.getWeChatCode() == null : this.getWeChatCode().equals(other.getWeChatCode()))
                && (this.getWeUnionId() == null ? other.getWeUnionId() == null : this.getWeUnionId().equals(other.getWeUnionId()))
                && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCreateId() == null) ? 0 : getCreateId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getOperaterId() == null) ? 0 : getOperaterId().hashCode());
        result = prime * result + ((getOperaterTime() == null) ? 0 : getOperaterTime().hashCode());
        result = prime * result + ((getOperaterStatus() == null) ? 0 : getOperaterStatus().hashCode());
        result = prime * result + ((getEnableStatus() == null) ? 0 : getEnableStatus().hashCode());
        result = prime * result + ((getStaffStatus() == null) ? 0 : getStaffStatus().hashCode());
        result = prime * result + ((getChannelStatus() == null) ? 0 : getChannelStatus().hashCode());
        result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getMail() == null) ? 0 : getMail().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getPromotionCode() == null) ? 0 : getPromotionCode().hashCode());
        result = prime * result + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
        result = prime * result + ((getFullName() == null) ? 0 : getFullName().hashCode());
        result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getHeadPortraitId() == null) ? 0 : getHeadPortraitId().hashCode());
        result = prime * result + ((getHeadPortraitUrl() == null) ? 0 : getHeadPortraitUrl().hashCode());
        result = prime * result + ((getWeChatCode() == null) ? 0 : getWeChatCode().hashCode());
        result = prime * result + ((getWeUnionId() == null) ? 0 : getWeUnionId().hashCode());
        result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
        return result;
    }
}